package com.sk.sk_frame_cloud.controller;


import com.sk.sk_frame_cloud.param.SysFunctionParam;
import com.sk.sk_frame_cloud.res.CommonResponse;
import com.sk.sk_frame_cloud.service.ISysProFunRelationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 项目与功能关系
 * @author jiaok
 * @since 2023-12-20
 */
@RestController
@RequestMapping("sys-pro-fun-relation")
public class SysProFunRelationController {

    @Resource
    private ISysProFunRelationService iSysProFunRelationService;


    @PostMapping({"getProBindingFuns"})
    @ApiOperation(value = "获取项目绑定的所有功能",notes = "获取项目绑定的所有功能",httpMethod = "POST")
    public CommonResponse getProBindingFuns(@RequestParam String proSid) {
        return  iSysProFunRelationService.getProBindingFuns(proSid);
    }

    @PostMapping({"addBindingProFunction"})
    @ApiOperation(value = "为当前项目绑定的功能",notes = "为当前项目绑定的功能",httpMethod = "POST")
    public CommonResponse addBindingProFunction(@RequestBody SysFunctionParam functionParam) {
        return  iSysProFunRelationService.addBindingProFunction(functionParam);
    }

    @PostMapping({"removeBindingProFunction"})
    @ApiOperation(value = "解绑项目的功能",notes = "解绑项目的功能",httpMethod = "POST")
    public CommonResponse removeBindingProFunction(@RequestBody SysFunctionParam functionParam) {
        return  iSysProFunRelationService.removeBindingProFunction(functionParam);
    }


}
